﻿//创建时间: 2010-10-11
//创建作者: 李晓忠
//功能说明: CMS系统 结点信息
//最后修改: 2010-10-14 添加树层级
using System;
using System.Collections.Generic;
using System.Text;

using TRPOP.Common;

namespace TRPOP.CMS.Model
{
    [Serializable]
    public class NodeInfo
    {
        #region 私有变量
        private int m_intNodeId = 0;
        private string m_strEditor = "";
        private string m_strPager = "";
        private string m_strIndexName = "index.html";
        private string m_strIndexPortalURL = "";
        private string m_strContentPortalURL = "";
        private int m_intInheritNodeID = 0;
        private int m_intParentId = 0;
        private int m_intModelId = 0;
        private string m_strName = "";
        private string m_strKeyWord = "";
        private string m_strUrl = "";
        private int m_intNodeTypeId = 0;
        private int m_intContentPubTypeId = 1;
        private bool m_blnIsAuoPub = false;
        private bool m_blnIsContribute = false;
        private bool m_blnIsHidde = false;
        private int m_intDisplayOrder = 0;
        private string m_strDetail = "";
        private string m_strIndexTemplate = "";
        private string m_strImageTemplate = "";
        private string m_strDetailTemplate = "";
        private string m_strSourcePSN = "";
        private string m_strSourceUrl = "";
        private string m_strSourceRootReg = "";
        private string m_strHtmlPSN = "";
        private string m_strHtmlUrl = "";
        private string m_strHtmlRootReg = "";
        private string m_strHtmlNameReg = "{TimeStamp}d{ContentID}.html";
        private string m_strSEOTitle = "";
        private string m_strSEOKey = "";
        private string m_strSEODescription = "";
        private int m_intReadLimit = 0;
        private DateTime m_datAddTime = StringExtension.NullDateTime;
        private int m_intAddUserId = 0;
        private int m_intUpdateUserId = 0;
        private DateTime m_datUpdateTime = StringExtension.NullDateTime;
        private string m_strWaterPic = "";
        private bool m_blnIsWater = false;
        private decimal m_decExtcredits1 = 0;
        private decimal m_decExtcredits2 = 0;
        private string m_strExtcredits3 = "";
        private string m_strExtcredits4 = "";
        private string m_strExtcredits5 = "";
        private string m_ParentPath = "";
        private string m_ArrChildId = "";
        #endregion

        #region 成员函数

        /// <summary>
        ///  结点id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int NodeId
        {
            get
            {
                return m_intNodeId;
            }
            set
            {
                m_intNodeId = value;
            }
        }

        /// <summary>
        ///  内容编辑器
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Editor
        {
            get
            {
                return m_strEditor;
            }
            set
            {
                m_strEditor = value;
            }
        }

        /// <summary>
        ///  内容分页生成器
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Pager
        {
            get
            {
                return m_strPager;
            }
            set
            {
                m_strPager = value;
            }
        }

        /// <summary>
        ///  结点首页文件名
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string IndexName
        {
            get
            {
                return m_strIndexName;
            }
            set
            {
                m_strIndexName = value;
            }
        }

        /// <summary>
        ///  结点首页入口URL
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string IndexPortalURL
        {
            get
            {
                return m_strIndexPortalURL;
            }
            set
            {
                m_strIndexPortalURL = value;
            }
        }

        /// <summary>
        ///  内容页入口URL
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string ContentPortalURL
        {
            get
            {
                return m_strContentPortalURL;
            }
            set
            {
                m_strContentPortalURL = value;
            }
        }

        /// <summary>
        ///  继承的实结点
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int InheritNodeID
        {
            get
            {
                return m_intInheritNodeID;
            }
            set
            {
                m_intInheritNodeID = value;
            }
        }

        /// <summary>
        ///  父id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int ParentId
        {
            get
            {
                return m_intParentId;
            }
            set
            {
                m_intParentId = value;
            }
        }

        /// <summary>
        ///  模型id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int ModelId
        {
            get
            {
                return m_intModelId;
            }
            set
            {
                m_intModelId = value;
            }
        }

        /// <summary>
        ///  名称
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Name
        {
            get
            {
                return m_strName;
            }
            set
            {
                m_strName = value;
            }
        }

        /// <summary>
        ///  Key
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string KeyWord
        {
            get
            {
                return m_strKeyWord;
            }
            set
            {
                m_strKeyWord = value;
            }
        }

        /// <summary>
        ///  URL
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Url
        {
            get
            {
                return m_strUrl;
            }
            set
            {
                m_strUrl = value;
            }
        }



        /// <summary>
        ///  结点类型id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int NodeTypeId
        {
            get
            {
                return m_intNodeTypeId;
            }
            set
            {
                m_intNodeTypeId = value;
            }
        }

        /// <summary>
        ///  发布模式id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int ContentPubTypeId
        {
            get
            {
                return m_intContentPubTypeId;
            }
            set
            {
                m_intContentPubTypeId = value;
            }
        }

        /// <summary>
        ///  是否自动发布
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public bool IsAuoPub
        {
            get
            {
                return m_blnIsAuoPub;
            }
            set
            {
                m_blnIsAuoPub = value;
            }
        }

        /// <summary>
        ///  是否支持投稿
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public bool IsContribute
        {
            get
            {
                return m_blnIsContribute;
            }
            set
            {
                m_blnIsContribute = value;
            }
        }

        /// <summary>
        ///  是否隐藏
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public bool IsHidde
        {
            get
            {
                return m_blnIsHidde;
            }
            set
            {
                m_blnIsHidde = value;
            }
        }

        /// <summary>
        ///  排列顺序
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int DisplayOrder
        {
            get
            {
                return m_intDisplayOrder;
            }
            set
            {
                m_intDisplayOrder = value;
            }
        }

        /// <summary>
        ///  结点内容
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Detail
        {
            get
            {
                return m_strDetail;
            }
            set
            {
                m_strDetail = value;
            }
        }

        /// <summary>
        ///  首页模板
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string IndexTemplate
        {
            get
            {
                return m_strIndexTemplate;
            }
            set
            {
                m_strIndexTemplate = value;
            }
        }

        /// <summary>
        ///   图片页模板
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string ImageTemplate
        {
            get
            {
                return m_strImageTemplate;
            }
            set
            {
                m_strImageTemplate = value;
            }
        }

        /// <summary>
        ///  内容页模板
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string DetailTemplate
        {
            get
            {
                return m_strDetailTemplate;
            }
            set
            {
                m_strDetailTemplate = value;
            }
        }

        /// <summary>
        ///  资源发布点
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SourcePSN
        {
            get
            {
                return m_strSourcePSN;
            }
            set
            {
                m_strSourcePSN = value;
            }
        }

        /// <summary>
        ///  资源发布URL
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SourceUrl
        {
            get
            {
                return m_strSourceUrl;
            }
            set
            {
                m_strSourceUrl = value;
            }
        }

        /// <summary>
        ///  资源发布目录规则
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SourceRootReg
        {
            get
            {
                return m_strSourceRootReg;
            }
            set
            {
                m_strSourceRootReg = value;
            }
        }

        /// <summary>
        ///  静态发布点(PSM)
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string HtmlPSN
        {
            get
            {
                return m_strHtmlPSN;
            }
            set
            {
                m_strHtmlPSN = value;
            }
        }

        /// <summary>
        ///  内容发布URL
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string HtmlUrl
        {
            get
            {
                return m_strHtmlUrl;
            }
            set
            {
                m_strHtmlUrl = value;
            }
        }

        /// <summary>
        ///  内容发布目录规则
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string HtmlRootReg
        {
            get
            {
                return m_strHtmlRootReg;
            }
            set
            {
                m_strHtmlRootReg = value;
            }
        }

        /// <summary>
        ///  内容页面命名规则
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string HtmlNameReg
        {
            get
            {
                return m_strHtmlNameReg;
            }
            set
            {
                m_strHtmlNameReg = value;
            }
        }

        /// <summary>
        ///  SEOTitle
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SEOTitle
        {
            get
            {
                return m_strSEOTitle;
            }
            set
            {
                m_strSEOTitle = value;
            }
        }

        /// <summary>
        ///  SEO关键字
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SEOKey
        {
            get
            {
                return m_strSEOKey;
            }
            set
            {
                m_strSEOKey = value;
            }
        }

        /// <summary>
        ///  SEO描述
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string SEODescription
        {
            get
            {
                return m_strSEODescription;
            }
            set
            {
                m_strSEODescription = value;
            }
        }

        /// <summary>
        ///  阅读权限
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int ReadLimit
        {
            get
            {
                return m_intReadLimit;
            }
            set
            {
                m_intReadLimit = value;
            }
        }

        /// <summary>
        ///  添加时间
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public DateTime AddTime
        {
            get
            {
                return m_datAddTime;
            }
            set
            {
                m_datAddTime = value;
            }
        }

        /// <summary>
        ///  添加者id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int AddUserId
        {
            get
            {
                return m_intAddUserId;
            }
            set
            {
                m_intAddUserId = value;
            }
        }

        /// <summary>
        ///  最后修改人ID
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int UpdateUserId
        {
            get
            {
                return m_intUpdateUserId;
            }
            set
            {
                m_intUpdateUserId = value;
            }
        }

        /// <summary>
        ///  最后修改时间
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public DateTime UpdateTime
        {
            get
            {
                return m_datUpdateTime;
            }
            set
            {
                m_datUpdateTime = value;
            }
        }

        /// <summary>
        ///  水印图片地址
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string WaterPic
        {
            get
            {
                return m_strWaterPic;
            }
            set
            {
                m_strWaterPic = value;
            }
        }

        /// <summary>
        ///  结点下图片是否水印
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public bool IsWater
        {
            get
            {
                return m_blnIsWater;
            }
            set
            {
                m_blnIsWater = value;
            }
        }

        /// <summary>
        ///  预留字段1
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public decimal Extcredits1
        {
            get
            {
                return m_decExtcredits1;
            }
            set
            {
                m_decExtcredits1 = value;
            }
        }

        /// <summary>
        ///  预留字段2
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public decimal Extcredits2
        {
            get
            {
                return m_decExtcredits2;
            }
            set
            {
                m_decExtcredits2 = value;
            }
        }

        /// <summary>
        ///  预留字段3
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Extcredits3
        {
            get
            {
                return m_strExtcredits3;
            }
            set
            {
                m_strExtcredits3 = value;
            }
        }

        /// <summary>
        ///  预留字段4
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Extcredits4
        {
            get
            {
                return m_strExtcredits4;
            }
            set
            {
                m_strExtcredits4 = value;
            }
        }

        /// <summary>
        ///  预留字段5
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string Extcredits5
        {
            get
            {
                return m_strExtcredits5;
            }
            set
            {
                m_strExtcredits5 = value;
            }
        }

        /// <summary>
        ///  结点父路径
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string ParentPath
        {
            get
            {
                return m_ParentPath;
            }
            set
            {
                m_ParentPath = value;
            }
        }
        /// <summary>
        ///  所有子节点id
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public string ArrChildId
        {
            get
            {
                return m_ArrChildId;
            }
            set
            {
                m_ArrChildId = value;
            }
        }
        #endregion


    }

    [Serializable]
    public class NodeInfoWithLevel : NodeInfo
    {
        #region 私有变量
        private int m_intLevel = 0;
        #endregion

        #region 成员函数
        /// <summary>
        ///  级数
        /// </summary>
        [DataAttribute(FieldType.DBField)]
        public int Level
        {
            get
            {
                return m_intLevel;
            }
            set
            {
                m_intLevel = value;
            }
        }
        #endregion

    }
}

